package com.visionet.order;

import org.junit.Test;
import redis.clients.jedis.Jedis;

/**
 * @Author: pengjx
 * @Date: 2019-02-12 17:37
 */
public class HelloRedis {

    @Test
    //连接到Redis服务
    public void test01() {
        Jedis jedis = new Jedis("localhost");
        System.out.println("连接成功");
        System.out.println("服务正在运行：" + jedis.ping());
    }

    @Test
    public void test02() {
        Jedis jedis = new Jedis("localhost");
        System.out.println("连接成功");
        jedis.set("test","paul");
        System.out.println("redis 存储的字符串为：" + jedis.get("test"));
    }
}
